
module SinatraHelpers
  class BootstrapApp < SinatraApp
    def self.invoke
      app = new
      app.create_webapp_rb
      app.create_config_ru
      app.create_index_haml
      app.create_layout_haml
    end
    def create_layout_haml conent = layout_haml
      super( conent )
    end
    def create_index_haml conent = index_haml
      super( conent )
    end

    private
    def index_haml
      ".hero\n" \
        "  %h1 Hello from Bootstrap"
    end
    def layout_haml
      "!!! 5\n" \
        "%html\n" \
        "  %head\n" \
        "    %meta{ :'http-equiv' => 'Content-Type', :content => 'text/html; charset=utf-8' }\n" \
        "    %link{ :href => 'bootstrap/css/bootstrap.css', :rel => 'sylesheet' }\n" \
        "    %link{ :href => 'bootstrap/css/bootstrap-responsive.css', :rel => 'sylesheet' }\n" \
        "    %script{ :src => 'jquery.js' }\n" \
        "    %script{ :src => 'bootstrap/js/bootstrap.js' }\n" \
        "  %body\n" \
        "    = yield\n"
    end
  end
end

